import request from "@/service/request";

export interface ProductPropertiesVO {
  propertyId?: number | null; // 属性的编号
  propertyName?: string; // 属性的名称
  valueId?: number | null; //属性值的编号
  valueName?: string; // 属性值的名称
}

// 查询商品列表分页
export const getList = async (data: any) => {
  return await request.get({
    url: `/hkb/goods/page`,
    data,
  });
};
// 查询商品列表全部
export const getListAll = async (data: any) => {
  return await request.get({ url: `/hkb/goods/list`, data });
};

// 新增商品
export const addProduct = async (data: any) => {
  return await request.post({
    headersType: "application/json",
    url: `/hkb/goods/create`,
    data: JSON.stringify(data),
  });
};

// 修改商品
export const editProduct = async (data: any) => {
  return await request.put({
    url: `/hkb/goods/update`,
    headersType: "application/json",
    data: JSON.stringify(data),
  });
};

// 删除商品
export const deleteProduct = async (id: any) => {
  return await request.delete({ url: `/hkb/goods/delete?id=` + id });
};
